# import requests
# from lxml.html import fromstring
# response = requests.get("https://www.baidu.com")

# print(type(response.text))
# print(response.text)

# print(type(response.content))
# print(response.content.decode("utf-8"))

# response = requests.get("https://www.baidu.com/s")

# params = {
#   "wd": "中国"
# }
# headers = {
#     'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36'
# }
#
# response = requests.get("https://www.amazon.com/dp/B010OW4KMW", headers=headers)
#
#
# with open('baidu.html','w',encoding="utf-8") as fp:
#   fp.write(response.content.decode('utf-8'))

#
# url = 'https://www.amazon.com/Best-Sellers-Health-Personal-Care/zgbs/hpc/ref=zg_bs_nav_0'
#
#
#
#
# print(url.split('ref=')[0]+'ref=zg_bs_pg_2?_encoding=UTF8&pg=2')
#
from db.mysql_conn import MysqlUtils, config, sqlStr
mysql = MysqlUtils(config)

# sqlParam = [goods['country'], goods['asin'], '', 0, goods['star'], goods['reviews'],
# #             goods['moneytype'], goods['price'], goods['url'], goods['name'], goods['img']]
# # mysql.insert(sqlStr, sqlParam)

best = mysql.query('select * from best0711 where asin="B07J4KG29H"')
print(best)
